import pulpcore.image.CoreImage;
import pulpcore.sprite.ImageSprite;
public class mushroom extends ImageSprite {
	private CoreImage mushroomImage;
	private boolean thrust = false;
	private double velocity = 0;
	private double time=-11;
	public mushroom(int x, int y){
		super(CoreImage.load("mushroom.png"), x, y);
		mushroomImage = (CoreImage.load("mushroom.png"));
	}
	public void update(int elapsedTime)
	{
		super.update(elapsedTime);
		moveMushroom();
	}
	private void moveMushroom()
	{
		x.set(x.get() + velocity);
	}
		
	public boolean isThrust()
	{
		return thrust;
	}

	public void setThrust(boolean thrust)
	{
		this.thrust = thrust;
		
		if(thrust)
		{
			setImage(mushroomImage);
		}
		else
		{
			velocity=0;
		}
	}
	public boolean isRunningRight() {
		return velocity > 0;
	}
	public void runRight()
	{
		velocity = 4;	
	}
	public void runLeft()
	{
		velocity = -4;
	}

	public void starter(){
		time++;
	}
}

